package lang

import (
	"context"
	"encoding/json"
	langApi "go-skeleton/api/admin/service/lang"
	"google.golang.org/protobuf/types/known/emptypb"
)

type LangService struct {
	langApi.UnimplementedLangServiceServer
}

func NewLangService() *LangService {
	return &LangService{}
}

func (s LangService) GetLang(ctx context.Context, req *emptypb.Empty) (resp *langApi.LangReply, err error) {

	demo := map[string]map[string]string{
		"router": {
			"home": "首页123",
		},
	}

	v, _ := json.Marshal(demo)
	return &langApi.LangReply{
		ZhCn: &langApi.LangMsg{
			Message: string(v),
		},
	}, nil
}
